From bdbd47818f3407748d8283919a2d89a7434808a7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Aug 2012 01:49:56 +0200 Subject: [PATCH] docs: Add examples for use of GDK_VERSION_MIN_REQUIRED I had to work this out for myself, so better document it. --- docs/reference/gtk/compiling.sgml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/reference/gtk/compiling.sgml b/docs/reference/gtk/compiling.sgml index 03206d9206..827e408a4e 100644 --- a/docs/reference/gtk/compiling.sgml +++ b/docs/reference/gtk/compiling.sgml @@ -63,6 +63,22 @@ to use. APIs that were deprecated before or introduced after this range will trigger compiler warnings. + +Here is how you would compile hello.c if you want to allow it +to use symbols that were not deprecated in 3.2: + +$ cc -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello + + + + +And here is how you would compile hello.c if you don't want +it to use any symbols that were introduced after 3.4: + +$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello + + + The older deprecation mechanism of hiding deprecated interfaces entirely from the compiler by using the preprocessor symbol -- 2.30.2